﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Kemvscafe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            Load_HomeSlide();
        GetTopKemvsCafeHot();
        Get5Res();
    }
    protected void Load_HomeSlide()
    {

        SQLHelper Dal = new SQLHelper();
        Dal.CommandType = CommandType.StoredProcedure;
        Dal.CommandText = "SP_GetIcreamAndCafeSlide";
        DataTable db = Dal.GetDataTable();
        Repeater1.DataSource = db;
        Repeater1.DataBind();
        Repeater3.DataSource = db;
        Repeater3.DataBind();

    }
    protected void GetTopKemvsCafeHot()
    {
        try
        {
            SQLHelper Dal = new SQLHelper();
            Dal.CommandType = CommandType.StoredProcedure;
            Dal.CommandText = "SP_GetAllCafeOnCafePage  ";
            DataTable db = Dal.GetDataTable();
            rptCafe.DataSource = db;
            rptCafe.DataBind();
        }
        catch
        {
            Response.Redirect("~/Error.aspx");
        }
    }
    protected void Get5Res()
    {
        SQLHelper Dal = new SQLHelper();
        Dal.Open();
        Dal.CommandType = CommandType.StoredProcedure;
        Dal.CommandText = "SP_GetTop5CafeHot";
        DataTable db = Dal.GetDataTable();
        Repeater2.DataSource = db;
        Repeater2.DataBind();
    }
}
